Option Strict Off
Option Explicit On
Friend Class CLS_IE
	Dim iPercentageComplete As Short
	
	Public WithEvents oIE As System.Windows.Forms.WebBrowser
	
	' Update remote database with browser ----------------------------------------------------------------------------------------------------
	
	Public Sub updateWithBrowser(ByRef sURL As String, ByRef sPostData As String)

        Throw New NotImplementedException
        'On Error Resume Next

        'logMessage(iDEBUG, "CLS_IE", "updateWithBrowser method call", "URL = " & sURL & " | POST data = " & sPostData)

        'If oIE Is Nothing Then

        '	On Error Resume Next

        '	oIE = New System.Windows.Forms.WebBrowser

        '	If Err.Number <> 0 Then

        '		logMessage(iERROR, "CLS_IE", "Could not create InternetExplorer object",  , Err.Number, Err.Description)

        '		MsgBox("Could not update records" & vbCrLf & "Reason : could not create Internet Explorer object")

        '		DLGupdating.terminate()

        '		Exit Sub

        '	Else

        '		logMessage(iDEBUG, "CLS_IE", "Created InternetExplorer object")

        '	End If

        'End If

        '' Set display properties for IE --------------------------------------------------------------------------------

        'oIE.Visible = False

        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer property oIE.AddressBar was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.AddressBar = False
        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer property oIE.Toolbar was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.Toolbar = False
        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer property oIE.MenuBar was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.MenuBar = False
        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer property oIE.StatusBar was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.StatusBar = True

        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer property oIE.StatusText was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.StatusText = "Updating"

        'oIE.Width = VB6.TwipsToPixelsX(300)
        'oIE.Height = VB6.TwipsToPixelsY(300)

        'Dim bPostData() As Byte

        ''UPGRADE_WARNING: Couldn't resolve default property of object getPostData(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'bPostData = getPostData(sPostData)

        ''UPGRADE_WARNING: Navigate2 was upgraded to Navigate and has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
        'oIE.Navigate(New System.URI(sURL),  )

        'logMessage(iINFO, "CLS_IE", "Navigate2 method of InternetExplorer object called", "URL = " & sURL & " | POST data = " & sPostData & " | From file ? " & MODweb.bUpdatedFromFile)

        'DLGupdating.init("Updating Remote Database", "Please wait while the remote database is updated", VB6.FormShowConstants.Modal)
		
	End Sub
	
	' Is called when update is comepleted, regardless of success ----------------------------------------------------------------------------
	
	Private Sub updateComplete(ByRef oWindow As Object)
        Throw New NotImplementedException
        'On Error Resume Next

        'Dim sSuccess As String

        'Dim oIEdoc As Object

        'On Error Resume Next

        ''UPGRADE_WARNING: Couldn't resolve default property of object oWindow.Document. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'oIEdoc = oWindow.Document

        'If Err.Number <> 0 Then

        '	logMessage(iWARNING, "CLS_IE", "Could not get IE.document object after documentComplete event", CStr(Err.Number), CInt(Err.Description))

        'Else

        '	logMessage(iDEBUG, "CLS_IE", "Got IE.document object after documentComplete event")

        'End If

        'On Error Resume Next

        ''UPGRADE_WARNING: Couldn't resolve default property of object oIEdoc.successStatus. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'sSuccess = LCase(oIEdoc.successStatus)

        'If Err.Number <> 0 Then

        '	'UPGRADE_WARNING: Couldn't resolve default property of object oIE.Document.body. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        '	logMessage(iWARNING, "CLS_IE", "Could not get successStatus property of IE.document object", "InnerHTML of body = " & oIE.Document.DomDocument.body.innerHTML, Err.Number, Err.Description)

        'Else

        '	logMessage(iINFO, "CLS_IE", "successStatus property of IE.document object returned as : " & sSuccess)

        'End If

        'Dim fso As Scripting.FileSystemObject
        'Dim sBackupPath As String
        'If sSuccess = "success" Then

        '	MsgBox("All records have been updated successfully")

        '	If MODweb.bUpdatedFromFile = True Then



        '		fso = New Scripting.FileSystemObject

        '		sBackupPath = MODweb.sRemoteUpdateBackupDirPath & "records_" & MODapplicationMain.getUniqueTimeStamp

        '		If Not fso.FolderExists(MODweb.sRemoteUpdateBackupDirPath) Then fso.CreateFolder(MODweb.sRemoteUpdateBackupDirPath)

        '		fso.MoveFile(MODweb.sRemoteUpdateRecordsFilePath, sBackupPath)

        '		If Err.Number <> 0 Then

        '			fso.CopyFile(MODweb.sRemoteUpdateRecordsFilePath, sBackupPath)

        '		End If

        '		MODweb.bUpdatedFromFile = False

        '	Else

        '		MODweb.resetStatementArray()

        '	End If

        '	FRMmain.bRemoteSaved = True

        'Else

        '	MsgBox("The records could not be updated." & vbCrLf & "It is recommended that you save the records for updating later")

        '	FRMmain.bRemoteSaved = False

        'End If

        ''UPGRADE_ISSUE: SHDocVw.InternetExplorer method oIE.Quit was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
        'oIE.Quit()

        ''UPGRADE_NOTE: Object oIE may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
        'oIE = Nothing
		
	End Sub
	
	' Fires when the document is completely loaded ----------------------------------------------------------------------------
	' This event will not fire in IE 5.5 or previous versions, when Visible property is false --------------------------
	
    'Private Sub oIE_DocumentComplete(ByVal eventSender As System.Object, ByVal eventArgs As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles oIE.DocumentComplete

    '	On Error Resume Next

    '	DLGupdating.terminate()

    '	updateComplete(eventArgs.pDisp)

    'End Sub
	
	' this event is always fired after a navigation starts. Any animation or "busy" indication that the container needs to display should be connected to this event. - MSDN
	
	'Private Sub oIE_DownloadComplete()
	
	'    On Error Resume Next
	
	'    DLGupdating.terminate
	
	'   updateComplete
	
	'End Sub
	
    'Private Sub oIE_NavigateError(ByVal eventSender As System.Object, ByVal eventArgs As AxSHDocVw.DWebBrowserEvents2_NavigateErrorEvent) Handles oIE.NavigateError

    '	On Error Resume Next

    '	DLGupdating.terminate()

    'End Sub
	
	' Quit event for browser -------------------------------------------------------------------------------------------------------------------
	
    'Private Sub oIE_OnQuit(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles oIE.OnQuit

    '	On Error Resume Next

    '	DLGupdating.terminate()

    '	'UPGRADE_NOTE: Object oIE may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
    '	oIE = Nothing

    'End Sub
	
    'Private Sub oIE_ProgressChange(ByVal eventSender As System.Object, ByVal eventArgs As AxSHDocVw.DWebBrowserEvents2_ProgressChangeEvent) Handles oIE.ProgressChange

    '	On Error Resume Next

    '	If eventArgs.ProgressMax < 1 Then Exit Sub

    '	iPercentageComplete = eventArgs.Progress * 100 / eventArgs.ProgressMax

    '	'UPGRADE_WARNING: Couldn't resolve default property of object DLGupdating.ProgressBar.Value. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
    '	DLGupdating.ProgressBar.Value = iPercentageComplete

    '	Debug.Print(eventArgs.Progress & " / " & eventArgs.ProgressMax & " / " & iPercentageComplete)

    'End Sub
End Class